# Contributor: Joshua Murphy <joshuamurphy@posteo.net>
# Maintainer: Joshua Murphy <joshuamurphy@posteo.net>
pkgname=sc-controller
pkgver=0.4.8.11
pkgrel=1
pkgdesc="User-mode driver and GTK3 based GUI for the Steam Controller"
url="https://github.com/Ryochan7/sc-controller"
# s390x: py3-vdf
arch="all !s390x"
license="GPL-2.0-only"
depends="
	gtk+3.0
	gtk-layer-shell
	librsvg
	libusb
	py3-cairo
	py3-evdev
	py3-gobject3
	py3-libacl
	py3-vdf
	"
makedepends="
	linux-headers
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	zlib-dev
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/Ryochan7/sc-controller/archive/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
e591e1c44763c38a18f09f8d5d9fcdb7f46c60d8f4dc040d82e48617d0f960abb6ec608188724838060dbe532589453b0be2c1d94686decef657205f8e8efcec  sc-controller-0.4.8.11.tar.gz
"
